regular expression to finite automata